<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 流年 <liu21st@gmail.com>
// +----------------------------------------------------------------------

// 应用公共文件

/**
 * 条件查询
 * @access private
 * @author 下雨吧จุ๊บ
 * @version 1.0
 * @param string $table 表名
 * @param array $where 查询条件
 * @return array or null
 */
function select($table,$where='')
{
    $data = \think\Db::table($table)->where($where)->select();
    return $data;
}

/**
 * 返回json格式
 * @access jsonType
 * @author 下雨吧จุ๊บ
 * @version 1.0
 * @param string or array $message 信息
 * @param string or array $status 状态
 * @return array or null
 */
function jsonType($message,$status)
{
    return array(
        'message' => $message,
        'status' => $status
    );
}